/*
 * Copyright 2010 Electronic Business Systems Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package gr.ebs.gssdroid.resource;

import org.json.JSONException;
import org.json.JSONObject;



/**
 * @author kman
 *
 */
public class GroupUserResource extends RestResource{

	public GroupUserResource(String aUri) {
		super(aUri);
	}

	String username;
	String name;
	String home;

	/**
	 * Retrieve the username.
	 *
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * Modify the username.
	 *
	 * @param aUsername the username to set
	 */
	public void setUsername(String aUsername) {
		username = aUsername;
	}

	/**
	 * Retrieve the name.
	 *
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Modify the name.
	 *
	 * @param aName the name to set
	 */
	public void setName(String aName) {
		name = aName;
	}

	/**
	 * Retrieve the home.
	 *
	 * @return the home
	 */
	public String getHome() {
		return home;
	}

	/**
	 * Modify the home.
	 *
	 * @param aHome the home to set
	 */
	public void setHome(String aHome) {
		home = aHome;
	}

	@Override
	public void createFromJSON(String text) throws JSONException {
		JSONObject json = new JSONObject(text);
		name = unmarshallString(json, "name");
		home = unmarshallString(json, "home");
		username = unmarshallString(json, "username");
	}

	@Override
	public String getLastModifiedSince() {
		return null;
	}
}
